mod msg;

const HEADER_LENGTH: u8 = 16;
const B0_MAGIC_HIGH: u8 = 0xda;
const B1_MAGIC_LOW: u8 = 0xbb;

const B2_FLAG_REQUEST: u8 = 0b1000_0000;
const B2_FLAG_TWOWAY: u8 = 0b0100_0000;
const B2_FLAG_EVENT: u8 = 0b0010_0000;
const B2_FLAG_SER_DUBBO: u8 = 0b0000_0001;
const B2_FLAG_SER_HESSIAN2: u8 = 0b0000_0010;
const B2_FLAG_SER_JAVA: u8 = 0b0000_0011;
const B2_FLAG_SER_FASTJSON: u8 = 0b0000_0110;

const B3_OK: u8 = 20;

/**
 * client side timeout.
 */
const B3_CLIENT_TIMEOUT: u8 = 30;

/**
 * server side timeout.
 */
const B3_SERVER_TIMEOUT: u8 = 31;

/**
 * request format error.
 */
const B3_BAD_REQUEST: u8 = 40;

/**
 * response format error.
 */
const B3_BAD_RESPONSE: u8 = 50;

/**
 * service not found.
 */
const B3_SERVICE_NOT_FOUND: u8 = 60;

/**
 * service error.
 */
const B3_SERVICE_ERROR: u8 = 70;

/**
 * internal server error.
 */
const B3_SERVER_ERROR: u8 = 80;

/**
 * internal server error.
 */
const B3_CLIENT_ERROR: u8 = 90;

/**
 * server side threadpool exhausted and quick return.
 */
const B3_SERVER_THREADPOOL_EXHAUSTED_ERROR: u8 = 100;
